<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>${site.name }</title>
<meta name="robots" content="index,follow" />
<%@ include file="../include/scripts.jsp" />
<script type="text/javascript">
	var appBase = "${base}";
	$(function() {
		$('#loginForm').submit(
				function() {
					$.post(appBase + "/auth/login", $(this).serialize(),
							function(result) {
								if (result == true) {
									alert("${msg['auth.login.success']}");
									$('#loginForm').hide();
									$('#logout').show();
								} else {
									alert("${msg['auth.login.fail']}");
								}
							}, "json");
					return false;
				});
		$('#logout').click(function() {
			$.post(appBase + "/auth/logout", function() {
				alert("${msg['auth.logout.success']}");
				$('#loginForm').show();
				$('#logout').hide();
			});
		});
	});
</script>
</head>
<body>
<form action="#" id="loginForm"><label for="auth.username">${msg['auth.username']}</label><input
	id="auth.username" type="text" name="username"></input> <label for="auth.password">${msg['auth.password']}</label><input
	id="auth.password" type="password" name="password"></input> <input type="submit" value="${msg['auth.login']}"></input>
</form>
<p />
<p />
<p />
<a href="#" id="logout" style="display: none">${msg['auth.logout']}</a>
</body>
</html>